import QtQuick 2.6
//import QtQuick.Window 2.12
import QtQuick.Controls 2.0

ApplicationWindow {
    id: root
    width: 300
    height: 480
    visible: true
//    title: qsTr("Hello World")

    Connections
    {
        target: mybackend
        onUserNameChanged: {
            console.log("收到来自C++的信号")
            mybackend.myTestInvokableFunc()
            mybackend.myTestPublicSlotsFunc()
        }
    }

    //文本输入框
    TextField {
        text: mybackend.userName

        placeholderText: qsTr("User name")
        anchors.centerIn: parent

        //当文本框的值改变后，将值传给backend类
        onTextChanged: mybackend.userName = text  //使用该函数 WRITE setUserName
    }
}
